

   fna = "sgp_2010_cam5.nc" 
   fnb = "sgp_input_aer.nc"

   fla = addfile(fna,"w") 
   flb = addfile(fnb,"r") 

   va = fla->T
   vb = fla->T
   dust_wrf = flb->num_dust
   hno3_wrf = flb->hno3

   va = 0.
   vb = 0.

   ;; va(0:743,:)     = 0. 
   ;; va(744:1463,:)  = 200. 
   ;; va(1464:2207,:) = 0. 

   va@units = "#/L" 
   va@standard_name = "dust number (D>200nm) " ;
   va@long_name = "dust number (D>200nm) " ;;

   vb@units = "ppmv" 
   vb@standard_name = "hno3 concentration " 
   vb@long_name = "hno3 concentration"  ;; 

   lev_scam5 = (/ 10000, 12500, 15000, 17500, 20000, 22500, 25000, 27500, 30000, 32500, \ 
                  35000, 37500, 40000, 42500, 45000, 47500, 50000, 52500, 55000, 57500, \ 
                  60000, 62500, 65000, 67500, 70000, 72500, 75000, 77500, 80000, 82500, \ 
                  85000, 87500, 90000, 92500, 95000, 97500, 100000 /) 


   lev_wrf = (/ 0.9965, 0.988, 0.9765, 0.962, 0.944, 0.9215, 0.8945, 0.8605438, 0.8216314, \
                0.782719, 0.7438065, 0.6893758, 0.6218525, 0.5590411, 0.5006675, \
                0.4464713, 0.3962049, 0.3496331, 0.3065324, 0.2666907, 0.2299065, \
                0.1959889, 0.1647566, 0.136038, 0.1096703, 0.08549951, 0.06337969, \
                0.04317284, 0.02474841, 0.007982971 /)

   lev_wrf = lev_wrf(::-1) * 100000. 


   print("lev_scam5 :   "  + lev_scam5) 
   print("lev_wrf   :   "  + lev_wrf) 

   dust_wrf(:,:) = (/ dust_wrf(:,::-1) /) 
   hno3_wrf(:,:) = (/ hno3_wrf(:,::-1) /) 

   dust_scam5 = linint1(lev_wrf,dust_wrf,False,lev_scam5,0)
   hno3_scam5 = linint1(lev_wrf,hno3_wrf,False,lev_scam5,0)
  
   nt = dimsizes(dust_scam5(:,0))  

   do it = 0,nt-1 
      va(744+it*3,:)   = (/ dust_scam5(it,:) /) 
      va(744+it*3+1,:) = (/ dust_scam5(it,:) /) 
      va(744+it*3+2,:) = (/ dust_scam5(it,:) /) 
      vb(744+it*3,:)   = (/ hno3_scam5(it,:) /) 
      vb(744+it*3+1,:) = (/ hno3_scam5(it,:) /) 
      vb(744+it*3+2,:) = (/ hno3_scam5(it,:) /) 
   end do 

   nk = dimsizes(lev_scam5) 

   va(:,nk-1) = (/ va(:,nk-2) /) 
   vb(:,nk-1) = (/ vb(:,nk-2) /) 

   fla->dust=va  
   fla->hno3=vb  




